<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="htmlPage" /></title>
</head>
<body>
    <h1><fmt:message key="htmlPage" /></h1>
    <div class="buttons">
       <c:url var="createUrl" value="/domain/htmlPage/createForm" />
       <a href="${createUrl}"><span><fmt:message key="label.link.create" /></span></a>
    </div>
    <c:url var="searchUrl" value="/domain/htmlPage/search" />
    <h2><fmt:message key="label.search.byExample" /></h2>
    <form:form action="${searchUrl}" modelAttribute="htmlPageSearchForm">
        <table>
            <tbody>
                <tr>
                    <th><fmt:message key="htmlPage_title" /></th>
                    <td>
                        <form:input path="htmlPage.title" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.title",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.title" />
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_modDate" /></th>
                    <td>
                        <form:input path="htmlPage.modDate" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.modDate",
                                widgetType : "dijit.form.DateTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.modDate" />
                    </td>
                    <th><fmt:message key="htmlPage_modUser" /></th>
                    <td>
                        <form:input path="htmlPage.modUser" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.modUser",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.modUser" />
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="htmlPage_pageUrl" /></th>
                    <td>
                        <form:input path="htmlPage.pageUrl" />
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "htmlPage.pageUrl",
                                widgetType : "dijit.form.ValidationTextBox",
                                widgetAttrs : {
                                    required : false
                                }
                            }));
                        </script>
                        <form:errors cssClass="error" path="htmlPage.pageUrl" />
                    </td>
                </tr>
                <tr>
                    <th><fmt:message key="label.pageSize" /></th>
                    <td>
                        <form:select path="searchParameters.pageSize">
                            <form:option value="1" label="1" />
                            <form:option value="5" label="5" />
                            <form:option value="10" label="10" />
                            <form:option value="25" label="25" />
                        </form:select>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.ElementDecoration({
                                elementId : "searchParameters.pageSize",
                                widgetType : "dijit.form.FilteringSelect",
                                widgetAttrs : {
                                    required: "false"
                            }}));
                        </script>
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="4">
                        <div class="buttons">
                            <button id="searchButtonEx" type="submit"><fmt:message key="label.search.submit" /></button>
                            <script type="text/javascript">
                                Spring.addDecoration(new Spring.ValidateAllDecoration({
                                    elementId:'searchButtonEx',
                                    event:'onclick'
                                }));
                            </script>
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form:form>
	<h2><fmt:message key="searchResult" /></h2>
	<jsp:include page="/WEB-INF/views/domain/htmlPage/searchResult.jsp" flush="true" >
		<jsp:param name="includeBody" value="true" />
	</jsp:include>

</body>
